<?php

namespace App\Http\Requests\Api;

class CompanySearchRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => !$this->is('*/update') ? '' : 'required|integer',
            'education' => 'integer',
            'sex' => 'integer|between:0,2',
            'chkphoto_open' => 'integer|between:0,1',
            'work_year' => 'integer',
            'age' => 'integer',
            'homeaddress' => 'integer',
            'census' => 'integer',
            'updatetime' => 'integer',
            'search_name' => 'required'
        ];
    }

    public function attributes()
    {
        return [
            'education' => '学历',
            'sex' => '性别',
            'chkphoto_open' => '只显示有相片的简历',
            'work_year' => '相关工作经验',
            'age' => '年龄',
            'homeaddress' => '现所在地',
            'census' => '户籍',
            'updatetime' => '更新日期',
            'search_name' => '搜索器名字'
        ];
    }

//    public function messages()
//    {
//        return array_merge(parent::messages(),[
//
//        ]);
//    }
}
